<?php 
/**
 * 首页图片的model
 * @author Administrator
 *
 */
class SyimgModel extends Model
{
	//设置表名
	protected $trueTableName = 'cmp_syimg';
	
	//设置主键
	protected  $key = 'sy_id';
	
	/**
	 * 获取首页模板图片数据
	 * @param unknown $id
	 * @return Ambigous <mixed, boolean, NULL, multitype:, unknown, string>
	 */
	public function getCardById($id)
	{
	
		//字段
		$field = array(
	
				'*',

		);
	
		//条件
		$where = $this->key.'='.$id;
	
		$result = $this->field($field)->where($where)->find();
	
		return $result;
	
	}
	
	/**
	 * 更新首页图片模板
	 * @return Ambigous <boolean, false, number>
	 */
	public function updateCard($data, $id)
	{
      
     // P($data);die();
		//字段
		$field = array(
					
				'*',
		);
	
		//字段过滤
		
		//P($data);die();
		//条件
		$where = $this->key.'='.$id;
	
		return $this->where($where)->save($data);
	}
}


?>